@using CodeGenerator
@using RazorLight
@using BXJG.Common;
@using BXJG.Common.Extensions;
@inherits TemplatePage<ExecuteContext>
@{
    DisableEncoding = true;//禁止html编码，因为我们是做代码生成器
}
using Abp.Application.Services.Dto;
using System.ComponentModel;
using BXJG.Common.Contracts;
using System.ComponentModel.DataAnnotations;
using System.Dynamic;
using @Model.Model.CoreShareNamespace;
@if(Model.Model.IsTree)
{
@:using BXJG.Utils.Application.Share.GeneralTree;    
}

namespace @(Model.Model.ApplicationShareNamespace)
{
    //Dto需要基础FullAuditEntity，且某些新增的数据可能不希望显示，因此dto不能继承CreateDto

    /// <summary>
    /// 各应用获取 @(Model.Model.DisplayName) 的数据模型
    ///</summary>
    public partial class @(Model.Model.DtoName) : @(Model.Model.IsTree ? $"GeneralTreeNodeBaseDto<{Model.Model.DtoName}>" : (Model.Model.PrimaryField.CSharpType == "int" ? "FullAuditedEntityDto" : $"FullAuditedEntityDto<{Model.Model.PrimaryField.CSharpType}>")), IExtendableObj
    {
@foreach (var field in Model.Model.NormalFields)
{<text>
        /// <summary>
        /// @(field.DisplayName)
        ///</summary>
        [Display(Name="@(field.DisplayName)")]
        public @(field.CSharpType)@(field.IsRequired?"":"?") @field.Name { get; set; }
</text>}       
        /// <summary>
        /// 扩展字段，通常仅用于UI
        ///</summary>
        public dynamic ExtensionData { get; set; } = new ExpandoObject();
    }
}